//
//  ViewController.swift
//  MKAlert
//
//  Created by 劢克科技 on 2019/5/16.
//  Copyright © 2019 meckey. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }
    @IBAction func handleClick(_ sender: Any) {
        let controller = MKAlertViewController(title: "Simple Alert", desc: "3 kinds of actions")
        controller.addAction(action: MKAlertAction(title: "第一个按钮"))
        controller.addAction(action: MKAlertAction(title: "第二个按钮"))
        controller.addAction(action: MKAlertAction(title: "第三个按钮"))
        controller.delegate = self
        present(controller, animated: false, completion: nil)
    }
}

extension ViewController: MKAlertViewControllerDelegate {
    func handleDismiss(atIndex: Int) {
        print("click at index: \(atIndex)")
    }
}
